﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LitJson {
    public class JSON<T> {
        public static String toJsonString(Object obj) {
            return JsonMapper.ToJson(JsonMapper.ToJson(obj));
        }
        public static T toJsonObject(String jsonString) {
            return JsonMapper.ToObject<T>(jsonString);
        }
        public static void TestSimple() {
            //JsonData jsonData2 = JsonMapper.ToObject(json2);
            JsonData data = new JsonData();

            data["pram"] = new JsonData();
            data["action"] = 0;

            data["pram"]["username"] = "male";
            data["array"] = new JsonData();
            data["array"].SetJsonType(JsonType.Array);
            data["array"].Add("a");


            string json2 = data.ToJson();

            Product product = new Product() {
                gameID = 0,
                productID = 1
            };
            string json3 = JsonMapper.ToJson(product);
        }
    }
   

    class Product {
        internal int gameID;
        internal int productID;
    }
}
